﻿Imports Microsoft.TeamFoundation.WorkItemTracking.Client
Imports Microsoft.TeamFoundation.WorkItemTracking.Controls
'Imports Microsoft.VisualStudio.TeamFoundation.WorkItemTracking


Public Class WitCustomControlBase(Of TWitWpfCustomControl As {New, UIElement, IWorkItemControl})
    Implements IWorkItemControl

#Region " IWorkItemControl "

    Public Event AfterUpdateDatasource(ByVal sender As Object, ByVal e As System.EventArgs) Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.AfterUpdateDatasource
    Public Event BeforeUpdateDatasource(ByVal sender As Object, ByVal e As System.EventArgs) Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.BeforeUpdateDatasource

    Public Property [ReadOnly]() As Boolean Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.ReadOnly
        Get
            Return Me.uxWitWpfCustomControl.[ReadOnly]
        End Get
        Set(ByVal value As Boolean)
            Me.uxWitWpfCustomControl.[ReadOnly] = value
        End Set
    End Property

    Public Sub SetSite(ByVal serviceProvider As System.IServiceProvider) Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.SetSite
        Me.uxWitWpfCustomControl.SetSite(serviceProvider)
    End Sub

    Public Property WorkItemDatasource() As Object Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.WorkItemDatasource
        Get
            Return Me.uxWitWpfCustomControl.WorkItemDatasource
        End Get
        Set(ByVal value As Object)
            Me.uxWitWpfCustomControl.WorkItemDatasource = value
        End Set
    End Property

    Public Property WorkItemFieldName() As String Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.WorkItemFieldName
        Get
            Return Me.uxWitWpfCustomControl.WorkItemFieldName
        End Get
        Set(ByVal value As String)
            Me.uxWitWpfCustomControl.WorkItemFieldName = value
        End Set
    End Property

    Public Property Properties() As System.Collections.Specialized.StringDictionary Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.Properties
        Get
            Return Me.uxWitWpfCustomControl.Properties
        End Get
        Set(ByVal value As System.Collections.Specialized.StringDictionary)
            Me.uxWitWpfCustomControl.Properties = value
        End Set
    End Property

    Public Sub Clear() Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.Clear
        Me.uxWitWpfCustomControl.Clear()
    End Sub

    Public Sub FlushToDatasource() Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.FlushToDatasource
        Me.uxWitWpfCustomControl.FlushToDatasource()
    End Sub

    Public Sub InvalidateDatasource() Implements Microsoft.TeamFoundation.WorkItemTracking.Controls.IWorkItemControl.InvalidateDatasource
        Me.uxWitWpfCustomControl.InvalidateDatasource()
    End Sub

#End Region

    Private Sub uxWitCustomControl_AfterUpdateDatasource(ByVal sender As Object, ByVal e As System.EventArgs) Handles uxWitWpfCustomControl.AfterUpdateDatasource
        RaiseEvent AfterUpdateDatasource(Me, e)
    End Sub

    Private Sub uxWitCustomControl_BeforeUpdateDatasource(ByVal sender As Object, ByVal e As System.EventArgs) Handles uxWitWpfCustomControl.BeforeUpdateDatasource
        RaiseEvent BeforeUpdateDatasource(Me, e)
    End Sub

End Class
